package com.magicmovie.mapper;

import com.github.pagehelper.Page;
import com.magicmovie.entity.Order;
import com.magicmovie.utils.QueryFilters;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    int deleteByPrimaryKey(String id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    Order findByUidAndMovieId(@Param("uid") Integer uid,@Param("movieId") Integer movieId);

    Page<Map<String,Object>> findByCustomer(Integer customerId);

    Order findByOrderNum(String orderNum);

    Page<Map<String, Object>> getByFilter(QueryFilters filters);

    Page<Map<String,Object>> getSitesList(@Param("startTime") String startTime,@Param("endTime") String endTime);

    Page<Map<String, Object>> siteDetails(QueryFilters queryFilters);

    List<Map<String,Object>> bestSellingList();

    Integer querySiteCount();

    Integer queryOrderAmount();

    Integer queryOrderCount();

    Integer queryPayedCustomer();

    List<Map<String,Object>> mostPaidUser();

    Double getMoneyByFilter(QueryFilters filters);
}